<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<div class="J_Chart_Panel">
	<div class="h_a1" style="clear: both;">
		<span class="title">开启过自动投标人数</span>
		<div class="yjd-tip">
			<div style="width: 500px;">
				1、处于开启状态人数：截止到指定时间的23：59：59，有过开启自动投标行为的用户数<br>
			</div>
		</div>
	</div>
	<div class="wrap">
		<form method="post" autocomplete="off" id="sumary1"
			action="${requestScope.FPWEB.rootPath }/autoinvest/summary1${requestScope.FPWEB.urlStuff}">
			<div class="search_type cc">
				<label>截止时间：</label>
				<input type="input" value="${now }" class="input length_1 mr10 J_date date" name="end" min="2013-12-21" max="${now }">
				<button id="search1" type="button" class="btn length_1">查询</button>
			</div>
		</form>
		<div id="cbox1" >
			<div id="c1" class="count cc" >
			<div class="c-box">
				<div class="c-box-head">开启过自动投标人数（人）</div>
				<div class="c-box-con">
					<span class="number" name="number">0</span> <span>人</span>
				</div>
			</div>
			<div class="c-box">
				<div class="c-box-head">[普通用户]开启过自动投标人数（人）</div>
				<div class="c-box-con">
					<span class="number" name="number">0</span> <span>人</span>
				</div>
			</div>

			<div class="c-box">
				<div class="c-box-head">[存管用户]开启过自动投标人数（人）</div>
				<div class="c-box-con">
					<span class="number" name="number">0</span> <span>人</span>
				</div>
			</div>
			</div>
		</div>
	</div>

	<div class="h_a1" style="clear: both;">
		<span class="title">基础数据-自动投标</span>
		<div class="yjd-tip">
			<div style="width: 500px;">
				1、投资人数：在指定的时间段，有自动投标行为发生的用户数<br>
				2、投资金额：在指定的时间段，自动投标金额之和<br>
			</div>
		</div>
	</div>
	<div class="wrap">
		<form method="post" autocomplete="off" id="sumary2"
			  action="${requestScope.FPWEB.rootPath }/autoinvest/summary2${requestScope.FPWEB.urlStuff}">
			<div class="search_type cc">
				<label>起始时间：</label>
				<input type="input" value="${start }" class="input length_1 mr10 J_date date" name="start" min="2013-12-21" max="${now }">
				<label>截止时间：</label>
				<input type="input" value="${now }" class="input length_1 mr10 J_date date" name="end" min="2013-12-21" max="${now }">
				<button id="search2" type="button" class="btn length_1">查询</button>
			</div>
		</form>
		<div id="cbox2" >
			<div id="c2" class="count cc" >
				<div class="c-box">
					<div class="c-box-head">投资人数（人）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>人</span>
					</div>
				</div>
				<div class="c-box">
					<div class="c-box-head">投资金额（元）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>元</span>
					</div>
				</div>

				<div class="c-box">
					<div class="c-box-head">[普通用户]投资人数（人）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>人</span>
					</div>
				</div>
				<div class="c-box">
					<div class="c-box-head">[普通用户]投资金额（元）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>元</span>
					</div>
				</div>

				<div class="c-box">
					<div class="c-box-head">[存管用户]投资人数（人）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>人</span>
					</div>
				</div>
				<div class="c-box">
					<div class="c-box-head">[存管用户]投资金额（元）</div>
					<div class="c-box-con">
						<span class="number" name="number">0</span> <span>元</span>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
<script>
	YJD.use('AppAdminCommon');
	YJD.use('AppBICommon');
	var form1=$("#sumary1");
	var form2=$("#sumary2");
	$("#search1").click(function(){
		addCompareData1();
	});
	$("#search2").click(function(){
		addCompareData2();
	});
	function addCompareData1() {
		var d=form1.serializeArray();
		var cbox=$("#c1");
		var boxes=cbox.find(".c-box");
		boxes.each(function(index,e){
			var val=$(this).find('span[name=number]');
			val.text("Loading...");
		});
		$.ajax({
			type: "post",
			url: form1.attr("action"),
			data :d,
			error:function(request){
				alert("连接失败！");
			},
			success:function(data){
				if (data.state == 1) {
					boxes.each(function(index,e){
						var val=$(this).find('span[name=number]');
						val.text(data.data.summaryVals[index]);
					});
				}
			}
		});
	}
	function addCompareData2() {
		var d=form2.serializeArray();
		var cbox=$("#c2");
		var boxes=cbox.find(".c-box");
		boxes.each(function(index,e){
			var val=$(this).find('span[name=number]');
			val.text("Loading...");
		});
		$.ajax({
			type: "post",
			url: form2.attr("action"),
			data :d,
			error:function(request){
				alert("连接失败！");
			},
			success:function(data){
				if (data.state == 1) {
					boxes.each(function(index,e){
						var val=$(this).find('span[name=number]');
						val.text(data.data.summaryVals[index]);
					});
				}
			}
		});
	}
	addCompareData1() ;
	addCompareData2() ;

</script>